﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace 桌面视频录制
{
    [Serializable]
    public class DrawArcWithFill : DrawArc
    {
        public DrawArcWithFill(Point startPoint)
            : base(startPoint) { }
        public override void Draw(Graphics g)
        {
            if (width < 1 || height < 1)
                return;
            Brush brush = this.DrawBrush.GetBrush();
            g.FillPie(brush, leftUpPoint.X, leftUpPoint.Y, width, height, (float)(startAngle * 180 / Math.PI), (float)(sweepAngle * 180 / Math.PI));
            brush.Dispose();
        }
        public override string ToString()
        {
            string printMsg = "[扇区(" + this.startPoint.X + "," + this.startPoint.Y + ")]->[ID:" + this.Id + "]";
            return printMsg;
        }
        public override string GetDrawObjectMsg()
        {
            string drawObjectMsg = "扇区->起始位置(" + this.startPoint.X + "," + this.startPoint.Y + "),宽高(" + (this.width / 2) + "," + (this.height / 2) + "),起始角度:" + ((int)(startAngle * 180 / Math.PI)) + "°,偏移角度:" + ((int)(sweepAngle * 180 / Math.PI)) + "°";
            return drawObjectMsg;
        }
    }
}
